<fieldset>
    <legend>条件搜索</legend>
    <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">学员姓名</label>
            <div class="layui-input-inline" style="width:140px;">
                <input name="name" value="{:input('name','')}" placeholder="请输入学员姓名" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">工作单位</label>
            <div class="layui-input-inline" style="width:140px;">
                <input name="company" value="{:input('company','')}" placeholder="请输入单位名称" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">复检日期</label>
            <div class="layui-input-inline" style="width:140px;">
                <input maxlength="64" value="{:input('time_span','')}" data-date-range placeholder="请在这里输入复检时间" name='time_span' class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-inline">
            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
        </div>
        <div class="layui-form-item layui-inline">
            <button name="btn-export" class="layui-btn margin-left-10" type="button">
                <i class="layui-icon layui-icon-export"></i>
                <span> 导出复检信息</span>
            </button>
        </div>
    </form>
</fieldset>

<script>window.form.render()</script>
<script>
    $("button[name=btn-export]").click(function () {
        location.href = '/cms/educertcheck/export.html?='+$("form.form-search").serialize();
    });
    $("input[name=upload-box]").change(function () {
        var url = $(this).val();
        $.ajax({
            type : "POST",
            url : "/cms/educert/import.html",
            data : {"url":url},
            success : function(result) {
                console.log(result);
                if(result.code==1){
                    location.reload();
                    layer.msg(result.info, {
                        time: 3000, //20s后自动关闭
                    });
                }else{
                    layer.msg(result.info);
                }
            },
            error : function(e){
                layer.msg(e.responseText, {
                    time: 5000, //20s后自动关闭
                });
            }
        });
    });
</script>